<template>
  <el-container>
    <el-aside width="200px">
          <h5>黑马头条</h5>
          <el-menu
            default-active="1"
            class="el-menu-vertical-demo"
            background-color="#304156"
            text-color="#9dcbd9"
            active-text-color="#ffd04b"
          >
            <el-menu-item index="1" @click="$router.push('/article')">
              <i class="el-icon-s-order"></i>
              <span slot="title">文章列表</span>
            </el-menu-item>
            <el-menu-item index="2" @click="$router.push('/publishArticle')">
              <i class="el-icon-s-claim"></i>
              <span slot="title">发布文章</span>
            </el-menu-item>
          </el-menu>
    </el-aside>
    <el-container>
      <el-header>Header</el-header>
      <el-main><router-view /></el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  created(){
    this.$axios({
      url:'/user/' + localStorage.getItem('userid'),
      headers:{
        Authorization : 'Bearer ' + localStorage.getItem('token')
      }
    }).then(res=>{
      console.log(res);
    })
  }
};
</script>

<style lang="less" scoped>
.el-container{
  .el-aside{
    h5{
      font-size: 24px;
      line-height: 60px;
      color: #ffffff;
    }
    .el-menu{
      border-color: #304156;
    }
  }
}
.el-container {
  height: 100vh;
}
.el-header,
.el-footer {
  background-color: #ffffff;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #304156;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>